<?php
/*
Template Name: Testimonials Template
*/
?>


<?php get_header(); ?>

<?php the_post(); 

$cust_back_img_id = get_post_meta($post->ID, 'arc_custom_background_image', true);

$cust_back_img = wp_get_attachment_url($cust_back_img_id);

?>

<script type="text/javascript">
			$(function() {		
				// initialize scrollable with mousewheel support
				$(".scrollable").scrollable({ vertical: true, mousewheel: true });	
			});
</script>

<!-- start Content Home -->				
<div class="content">


<div class="titlepage">
	<p><span><?php the_title(); ?></span></p>
</div>
<div class="slideimg">
	<?php if(!empty($cust_back_img)){ ?>
	<img src="<?php echo $cust_back_img; ?>" width="882px" height="564px">
	<?php } ?>
	
					<div class="testimonials">
					<div id="actions">
   						<a class="prev"></a>
   						<a class="next"></a>
					</div>
					
					<div class="scrollable vertical">

						
						<!-- root element for the scrollable elements -->
					   <div class="items">
					   
					   <?php 
						 		$testi_list = get_posts( array( 'numberposts' => -1, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'testimonials', 'post_status' => 'publish' ) );
						 		$testi_total = 1; 
						 		
						 		//print_r($testi_list);
						 ?>
								
								<?php foreach ($testi_list as $tl) :  setup_postdata($tl);
										if(($testi_total-1) % 3 == 0)
											echo "<div>";
								?>
					         <!-- row <?php echo $testi_total; ?> -->
					         <div class="item testbox">
					         		
					         		<?php
				
												$cust_testi_img_id = get_post_meta($tl->ID, 'arc_testi_image', true);
												
												$cust_testi_img = wp_get_attachment_url($cust_testi_img_id);
												
												$cust_testi_author = get_post_meta($tl->ID, 'arc_testi_author', true);
												$cust_testi_company = get_post_meta($tl->ID, 'arc_testi_company', true);
												
											?>
					            <?php if(!empty($cust_testi_img)){ ?>
												<img src="<?php echo $cust_testi_img; ?>" class="avatar" width="90px" height="85px">
											<?php } ?>
											
											<div class="text_testi">
												<i><?php the_content(); ?></i>
												<p class="ncmp"><span class="namet"><?php echo $cust_testi_author; ?></span><?php if(!empty($cust_testi_company)) echo ", " . $cust_testi_company; ?></p>
											</div>
					
					         </div>
					         <div class="typedivider"></div>
					      
					      <?php 
					      	$testi_total++;
					      	if(($testi_total-1) % 3 == 0)
											echo "</div>";
					      	
					      	 ?>
								<?php endforeach; ?>
								</div>
					      </div>
							</div>
					</div>

		<div class="hidecorner"></div>
		
		</div>	
	</div>	
</div>

<?php get_footer(); ?>